package com.han.walkman.service.impl;

import com.han.walkman.dao.OrgTypeDao;
import com.han.walkman.entity.OrgTypeEntity;
import com.han.walkman.service.OrgTypeService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: Hanjiafeng
 * @Date: 2020/5/10
 * @Desc:
 */
@Service
public class OrgTypeServiceImpl implements OrgTypeService {

    private final OrgTypeDao orgTypeDao;

    public OrgTypeServiceImpl(OrgTypeDao orgTypeDao) {
        this.orgTypeDao = orgTypeDao;
    }

    @Override
    public void addType(OrgTypeEntity orgTypeEntity) {
        orgTypeDao.save(orgTypeEntity);
    }

    @Override
    public void updateType(OrgTypeEntity orgTypeEntity) {
        orgTypeDao.save(orgTypeEntity);
    }

    @Override
    public void deleteType(OrgTypeEntity orgTypeEntity) {
        orgTypeDao.delete(orgTypeEntity);
    }

    @Override
    public List<OrgTypeEntity> findAll() {
        return orgTypeDao.findAll();
    }
}
